<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .ceshi {
        width: 300px;
        height: 300px;
        background-color: lime;
      }
    </style>
  </head>
  <body>
    <!-- 1. 先准备一个容器 -->
    <!-- 在vue中事件对象的名字是固定的 叫$event  -->
    <!-- 简单的写法 当没有参数的时候，不加小括号就行了 -->
    <div id="app">
      <div class="ceshi" @click="fn1($event)"></div>
      <div class="ceshi" @click="fn1"></div>
    </div>
    <!-- 2. 引框架 -->
    <script src="./vue.js"></script>
    <script>
      // 3.初始化vue实例对象
      const vm = new Vue({
        el: "#app",
        data: {},
        methods: {
          fn1(e) {
            console.log(e);
          },
        },
      });

      //   btn.onclick = function(e){

      //   }
    </script>
  </body>
</html>
